package com.example.qrcode.controller;
import com.example.qrcode.service.DataBindingService;
import com.example.qrcode.vo.SceneBindingAiDataVO;
import com.example.qrcode.vo.SceneBindingDiDataVO;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Slf4j
@RestController
@RequestMapping("/binding")
@RequiredArgsConstructor
@CrossOrigin
public class DataBindingController {

    private final DataBindingService dataBindingService;

    /**
     * 获取AI数据绑定信息
     */
    @GetMapping("/getSceneBindingAiData/{productSNo}")
    public List<SceneBindingAiDataVO> getSceneBindingAiData(@PathVariable("productSNo") String productSNo) {
        log.info("获取AI数据绑定信息, productSNo: {}", productSNo);
        return dataBindingService.getSceneBindingAiData(productSNo);
    }

    /**
     * 获取DI数据绑定信息
     */
    @GetMapping("/getSceneBindingDiData/{productSNo}")
    public List<SceneBindingDiDataVO> getSceneBindingDiData(@PathVariable("productSNo") String productSNo) {
        log.info("获取DI数据绑定信息, productSNo: {}", productSNo);
        return dataBindingService.getSceneBindingDiData(productSNo);
    }
}

